package com.tanhua.backmanage.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.common.mapper.UserInfoMapper;
import com.tanhua.common.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserInfoServiceQQ {

    @Autowired
    private UserInfoMapper userInfoMapper;

    public IPage<UserInfo> queryByPage(QueryWrapper<UserInfo> queryWrapper, Page<UserInfo> userInfoPage) {
        return userInfoMapper.selectPage(userInfoPage, queryWrapper);
    }

    public UserInfo queryById(Long userId) {
        QueryWrapper<UserInfo> query = new QueryWrapper<>();
        query.eq("user_id", userId);
        return userInfoMapper.selectOne(query);

    }
}
